//  this library.
enum SexEnum {
  boy(desc: "男", code: 0),
  girl(desc: "女", code: 1),
  other(desc: "其他", code: 2),
  unknown(desc: "未知", code: 3),
  ;

  final String desc;

  final int code;

  const SexEnum({
    required this.desc,
    required this.code,
  });

  static SexEnum? getTypeEnum(String type) {
    var values = SexEnum.values;
    for (var value in values) {
      if (value.name == type) {
        return value;
      }
    }
    return null;
  }
}
